package com.health.db.dao.user.impl;
 
import java.util.List;

import com.health.db.dao.ServiceInterface;
import com.health.db.dao.user.IZDocSortListDao;
import com.health.db.mapper.ZDocSortListMapper;
import com.health.db.model.ZDocSortList;
import com.health.redis.RedisConstants;


public class ZDocSortListDaoImpl extends ServiceInterface implements IZDocSortListDao {

	ZDocSortListMapper ZDocSortListMapper;
	
	@Override
	public List<ZDocSortList> selectSimpleForInit() {
		
		getRedisOperatiorLogic();
		String key=RedisConstants.ZDocSortListMapper;
		List<ZDocSortList> list=null;
		Object object=null;
	
		if(redisOperatiorLogic.isJedisIsConnected())
		{
			object = redisOperatiorLogic.readObject(key, getOrderRedisGroupNo("1"));
		}
		if(null!=object){
			if (!object.equals("")) {
				list =  (List) object;
			}
		}
		else
		{
			list=ZDocSortListMapper.selectSimpleForInit();
			if(redisOperatiorLogic.isJedisIsConnected())
			{
			redisOperatiorLogic.setEx(key, list, getOrderRedisGroupNo("1"));
			}
		}
		
		// TODO Auto-generated method stub
		return  list;
	}

	/**
	 * @return the zDocSortListMapper
	 */
	public ZDocSortListMapper getZDocSortListMapper() {
		return ZDocSortListMapper;
	}

	/**
	 * @param zDocSortListMapper the zDocSortListMapper to set
	 */
	public void setZDocSortListMapper(ZDocSortListMapper zDocSortListMapper) {
		ZDocSortListMapper = zDocSortListMapper;
	}
    
}
